/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
 package com.hercules.android.receiver;

import java.util.HashMap;
import java.util.Map;

import android.graphics.PointF;
import android.view.View;

import com.hercules.android.receiver.model.objects.XREView;
import com.hercules.android.receiver.painting.views.AndroidXREView;

/**
 * Auxiliary data used by performing local behavior.
 * 
 * @author ningh
 *
 */
public class LocalBehaviorData {
	/** Represents the app root view. */
    private AndroidXREView rootView = null;
    /** Represents points where mouse was moved. */
    private final Map<Integer, PointF> points = new HashMap<Integer, PointF>();
    /**  Represents the scale ratio of the root view */
	private float appScaleRatio = 1;
	/** Represents the scale point ids. */
	private final int[] scalePointIds = new int[2];
	/** Represents whether the scale starts. */
	private boolean scaleStarted = false;
	/** Represents the activity content view. */
	private AndroidXREView contentView = null;
	/** Represents the scale start value. */
	private float scaleStartValue = 1.f;
	/** Represents the scale start offset. */
	private PointF scaleStartScroll = null;
	/** Represents the scale start distance. */
	private float scaleStartDistance = 0;
	/** Represents the scale start center. */
	private PointF scaleStartCenter = null;
	/** Represents move started */
	private boolean moveStarted = false;
	/** Represents move started */
	private View focusedView = null;
	/** Represents move started */
	private XREView focusedXREView = null;
	/** Represents move started */
	private AndroidReceiver focusedReceiver = null;
	
	/**
	 * Default ctor.
	 */
	public LocalBehaviorData() {
		// do nothing
	}
	
	/**
     * Gets app scale ratio.
     */
    public float getAppScaleRatio() {
		return appScaleRatio;
    }
    
    /**
     * Sets app scale ratio.
     */
    public void setAppScaleRatio(float ratio) {
		appScaleRatio = ratio;
    }
    
    /**
     * Gets root view of the activity.
     */
    public AndroidXREView getRootView() {
		return rootView;
    }
    
    /**
     * Sets root view of the activity. 
     */
    public void setRootView(AndroidXREView view) {
    	rootView = view;
    }

    /**
     * Gets the points.
     */
    public Map<Integer, PointF> getPoints() {
    	return points;
    }
    
    /**
     * Gets the the scale point ids.
     */
    public int[] getScalePointIds() {
		return scalePointIds ;
    }

    /**
     * Sets the scale started.
     */
	public void setScaleStarted(boolean scaleStarted) {
		this.scaleStarted = scaleStarted;
	}

	/**
	 * Gets the scale started.
	 */
	public boolean getScaleStarted() {
		return scaleStarted;
	}

	/**
	 * @param contentView the contentView to set
	 */
	public void setContentView(AndroidXREView contentView) {
		this.contentView = contentView;
	}

	/**
	 * @return the contentView
	 */
	public AndroidXREView getContentView() {
		return contentView;
	}

	/**
	 * @param scaleStartValue the scaleStartValue to set
	 */
	public void setScaleStartValue(float scaleStartValue) {
		this.scaleStartValue = scaleStartValue;
	}

	/**
	 * @return the scaleStartValue
	 */
	public float getScaleStartValue() {
		return scaleStartValue;
	}

	/**
	 * @param scaleStartOffset the scaleStartOffset to set
	 */
	public void setScaleStartScroll(PointF scaleStartScroll) {
		this.scaleStartScroll = scaleStartScroll;
	}

	/**
	 * @return the scaleStartOffset
	 */
	public PointF getScaleStartScroll() {
		return scaleStartScroll;
	}

	/**
	 * @param scaleStartDistance the scaleStartDistance to set
	 */
	public void setScaleStartDistance(float scaleStartDistance) {
		this.scaleStartDistance = scaleStartDistance;
	}

	/**
	 * @return the scaleStartDistance
	 */
	public float getScaleStartDistance() {
		return scaleStartDistance;
	}

	/**
	 * @param scaleStartCenter the scaleStartCenter to set
	 */
	public void setScaleStartCenter(PointF scaleStartCenter) {
		this.scaleStartCenter = scaleStartCenter;
	}

	/**
	 * @return the scaleStartCenter
	 */
	public PointF getScaleStartCenter() {
		return scaleStartCenter;
	}

	/**
	 * @param moveStarted the moveStarted to set
	 */
	public void setMoveStarted(boolean moveStarted) {
		this.moveStarted = moveStarted;
	}

	/**
	 * @return the moveStarted
	 */
	public boolean getMoveStarted() {
		return moveStarted;
	}

	/**
	 * @param focusedView the focusedView to set
	 */
	public void setFocusedView(View focusedView) {
		this.focusedView = focusedView;
	}

	/**
	 * @return the focusedView
	 */
	public View getFocusedView() {
		return focusedView;
	}

	/**
	 * @param focusedReceiver the focusedReceiver to set
	 */
	public void setFocusedReceiver(AndroidReceiver focusedReceiver) {
		this.focusedReceiver = focusedReceiver;
	}

	/**
	 * @return the focusedReceiver
	 */
	public AndroidReceiver getFocusedReceiver() {
		return focusedReceiver;
	}

	/**
	 * @param focusedXREView the focusedXREView to set
	 */
	public void setFocusedXREView(XREView focusedXREView) {
		this.focusedXREView = focusedXREView;
	}

	/**
	 * @return the focusedXREView
	 */
	public XREView getFocusedXREView() {
		return focusedXREView;
	}
}
